1. Field of the Invention
The present invention relates to a picture processing apparatus, in particular, to an apparatus for compressing and encoding picture data with a CPU (Central Processing Unit) or a DSP (Digital Signal Processor) and an apparatus for reproducing picture data from compressed picture code with a CPU or a DSP.
2. Description of the Related Art
If digitized picture data are directly recorded in a record medium such as a CD-ROM and a hard disk, required capacity of record media becomes huge. Thus, the digitized picture data are normally compressed before recorded. DCT (Discrete Cosine Transform) coding has been more widely used in compression systems than other method such as DPCM and other orthogonal transform codings. For example, DCT coding is used in international encoding standards such as JPEG (Joint Photographic coding Experts Group) and MPEG (Moving Picture coding Experts Group). DCT coding utilizes its characteristics that power spectrum concentrates in lower frequency components of DCT coefficients.
FIG. 24 is a schematic diagram showing hierarchical levels of a coding format corresponding to MPEG. Referring to FIG. 24, MPEG codes are hierarchically structured. The top hierarchical level is a video sequence. The video sequence is composed of a plurality of GOPs (Group Of Pictures). Each GOP is composed of a plurality of pictures. One picture represents one frame. Pictures can be categorized into I pictures, P pictures, and B pictures. I pictures are intra-frame encoded. P pictures are forward inter-frame encoded. B pictures are forward/backward inter-frame encoded. Each picture is composed of a plurality of slices. Each slice is composed of a plurality of macro blocks that are arranged from left to right and from top to bottom. Each macro block is composed of a total of six blocks. Four blocks of them are luminance components (Y1, Y2, Y3, and Y4) and two blocks of them are color difference components (Cb and Cr). Each of blocks is composed of 8.times.8 pixels. Each block is the minimum coding unit.
Next, with reference to the accompanying drawings, a picture compressing system corresponding to a conventional DCT system such as MPEG will be described.
FIG. 25 is a block diagram showing a structure of a picture compressing apparatus that compresses picture data corresponding to MPEG. Referring to FIG. 25, the picture compressing apparatus reads RGB pixel data of the picture. YUV converting means 205 converts the RGB pixel data into YUV pixel data. Motion estimating means 206 searches the motion of macro blocks of the present frame relative to preceding/following frames. As mentioned above, pictures are categorized into three types of pictures: I pictures which are intra-frame encoded, P pictures which are interframe encoded, and pictures which are forward/backward inter-frame encoded. Thus, three types of compressing processes are performed.
In the case of I pictures, DCT means 208 transforms block data in the present frame to DCT coefficients. A quantizing means 209 quantizes the DCT coefficients. A variable length encoding means 210 compresses with high-efficiency the quantized DCT coefficients to Huffman codes.
Reproduced picture data used as reference in encoding P pictures and B pictures are obtained from quantized DCT coefficients as follows. Dequantizing means 214 dequantizes the quantized DCT coefficients. IDCT (Inverse Discrete Cosine Transform) means 213 performs the inverse discrete cosine transform for the dequantized DCT coefficients. The obtained picture data are stored in reference frame portion 211.
In the case of P pictures, motion-compensated predicting means 207 calculates the differences between the level of the pixels of each blocks in the present frame and the level of the pixels in the preceding frame read out from the reference frame portion 211 with the displacement pointed out by a motion vector searched by the motion estimating means 206. The DCT means 208 performs the discrete cosine transform for the differential data to produce DCT coefficients. The quantizing means 209 quantizes the DCT coefficients. The variable length encoding means 210 compresses with high-efficiency the quantized DCT coefficients to Huffman codes.
Reproduced picture data used as reference in encoding other P pictures and B pictures are obtained from quantized DCT coefficients as follows. Dequantizing means 214 dequantizes the quantized DCT coefficients. IDCT (Inverse Discrete Cosine Transform) means 213 performs the inverse discrete cosine transform for the dequantized DCT coefficients to generate differential data. The picture data in reference frame portion 211 are read out with the displacement pointed out by motion vector and added to the differential data. The sums are stored in reference frame portion 211.
In the case of B pictures, the motion-compensated predicting means 207 calculates the differential data between the level of the pixels of the block in the present frame and the level of the pixels in the preceding or following frame read out from the reference frame portion 211 with the displacement pointed out by a motion vector searched by the motion estimating means 206. The DCT means 208 performs the discrete cosine transform for the differential data to generate DCT coefficients. The quantizing means 209 quantizes the DCT coefficients. The variable length encoding means 210 compresses with high-efficiency the quantized DCT coefficients to Huffman codes. Since B pictures are not used as a reference frame, reproduced picture data are not regenerated from the quantized DCT coefficients in B pictures.
Next, with the reference to the accompanying drawings, a picture data reproducing system will be described. FIG. 26 is a block diagram showing the structure of a picture reproducing apparatus that reproduces picture data from the codes which are generated by picture compressing system or conform to MPEG syntax.
The picture data reproducing apparatus shown in FIG. 26 decodes I pictures that have been intra-frame encoded, P pictures that have been forward inter-frame encoded, and B pictures that have been forward or backward inter-frame encoded.
In the case of I pictures, picture data are reproduced as follows. The variable length decoding means 225 decodes variable length codes to regenerate quantized DCT coefficients. The dequantizing means 226 dequantizes the quantized DCT coefficients to regenerate dequantized DCT coefficients. The IDCT means 227 performs the inverse discrete cosine transform for the dequantized DCT coefficients to regenerate the YUV pixel data. RGB converting means 228 converts YUV pixel data into RGB pixel data and outputs the RGB pixel data.
In the case of P pictures, picture data are reproduced as follows. The variable length decoding means 225 decodes variable length codes to regenerate quantized DCT coefficients. The dequantizing means 226 dequantizes the quantized DCT coefficients. The IDCT means 227 performs the inverse discrete cosine transform to regenerate the differential data. The data of preceding frame read out from the reference frame portion 229 are compensated in motion by the motion compensating means 230 and added to the differential data to regenerate data in the present frame. The RGB converting means 228 converts the resultant data into RGB pixel data and outputs the RGB pixel data.
In the case of B pictures, picture data are reproduced as follows. The variable length decoding means 225 decodes variable length codes to regenerate quantized DCT coefficients. The dequantizing means 226 dequantizes the quantized DCT coefficients. The IDCT means 227 performs the inverse discrete cosine transform to regenerate the differential data. The data of preceding frame or following frame read out from the reference frame portion 229 are compensated in motion by the motion compensating means 230 and added to the differential data to regenerate data in the present frame. The RGB converting means 228 converts the resultant data into RGB pixel data and outputs the RGB pixel data.
Thus, corresponding to the international standard MPEG system, a picture data can be compressed with high-efficiency and reproduced. However, since the motion estimating, motion-compensated predicting process and the DCT/IDCT process require a large number of calculations, when a picture data are compressed and reproduced by software on CPU or DSP, it should be processed with an optimum program corresponding to the characteristic of each of CPUs, DSPs.
Thus, a variety of programs corresponding to a variety of CPUs, DSPs should be provided and they should be switched to cope with each of CPUs and DSPs.
As a related art reference for switching a plurality of programs, a system which switches a plurality of encoding/decoding processes on a time sharing basis with a priority has been proposed in Japanese Patent Laid-Open Publication 63-234,461. In addition, for example, in Japanese Patent Laid-Open Publication No. 2-108119, a structure of which a plurality of data compressing means are provided and data are compressed by the optimum means with the most compression efficiency is disclosed. In Japanese Patent Laid-Open Publication No. 5-233267, a structure of a program ROM built-in apparatus of which both a compressed program stored in a ROM and a differential program stored in a backup RAM are both developed in a RAM to compose a executable program has been proposed.
However, in the conventional picture compressing and reproducing apparatuses, a large number of programs corresponding to a large number of CPUs, DSPs, and so forth are required. Thus, the storage capacity of programs becomes large.
In addition, whenever apparatuses are switched, programs must also be switched. Thus, the process becomes complicated.